<?php
namespace Common\Model;
use Think\Model\RelationModel;
class ContentsModel extends RelationModel{
    
    
    protected $_link = array(
        'user'=>array(
        	'mapping_type'=>self::BELONGS_TO,
        	'class_name' => 'Users',
        	'foreign_key' => 'uid',
        	'as_fields' => 'username,nickname,avater'
        ),
       'cids'=>array(
        	'mapping_type'=>self::HAS_MANY,
        	'class_name' => 'ContentCats',
        	'foreign_key' => 'content_id',
        	'as_fields' => 'cid'
        )
    );
}